// pages/pickUpSuccessful/pickUpSuccessful.js
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    var pickupCabinetNumber = JSON.parse(options.pickupCabinetNumber);
    pickupCabinetNumber = pickupCabinetNumber.join('、');
    this.setData({
      doorList: pickupCabinetNumber,
      oid: options.oid
    })
  },

  //打开柜门
  openDoor: function () {
    var that = this;
    api.POST({
      params: { oid: that.data.oid },
      url: app.globalData.base_url + 'order/pickup',
      success: function (res) {
        if (util.isEmpty(res.data.code)) {
          wx.switchTab({
            url: '/pages/index/index'
          })
        } else {
          util.showError(res.data.message);
        }
      },
      fail: function (fail) {
        util.showError("网络错误");
      }
    })
  },
})